(function(){var e=window.BX;if(e.file_input)return;e.file_input=function(i){this.arConfig=i;e.ready(e.proxy(this.Init,this))};e.file_input.prototype.Init=function(){this.id=this.arConfig.id;this.multiple=this.arConfig.multiple;this.maxCount=parseInt(this.arConfig.maxCount)||0;this.inputSize=this.arConfig.inputSize||50;this.fileCount=0;this.newFileCount=0;this.pCont=e(this.id+"_cont");if(!this.pCont){setTimeout(e.proxy(this.Init,this),100);return}if(this.arConfig.useMedialib||this.arConfig.useFileDialog){this.arConfig.menuExist.push({TEXT:e.message("ADM_FILE_INSERT_PATH"),ONCLICK:e.proxy(this.ShowPath,this)});this.arConfig.menuNew.push({TEXT:e.message("ADM_FILE_INSERT_PATH"),ONCLICK:e.proxy(this.ShowPath,this)})}if(this.multiple)this.pCont.style.marginBottom="14px";this.pNewMenu=e(this.id+"_menu_new");if(this.pNewMenu)this.SetOpenerMenu(this.pNewMenu,this.arConfig.menuNew);if(this.arConfig.fileExists&&this.arConfig.files){for(var i=0;i<this.arConfig.files.length;i++)this.DisplayExistFile(i)}this.fileCount=this.arConfig.files.length;this.oFiles=[];this.oNewFile=this.DisplayFileBlock();this.oNewFile.pTextInput.id=this.id+"_text_input";if(!this.arConfig.useUpload){if(this.multiple){this.SetInputName(this.oNewFile.pTextInput,this.GetInputName("file_dialog"));this.ShowFileDescription(this.oNewFile);this.PushToFiles(this.oNewFile)}else{this.SetInputName(this.oNewFile.pTextInput,this.GetInputName("first_input"));this.ShowFileDescription(this.oNewFile)}}else if(!this.arConfig.fileExists&&this.arConfig.useUpload){this.oNewFile.pFileCont.appendChild(e.create("INPUT",{props:{type:"file",name:this.GetInputName("first_input"),className:"adm-designed-file adm-input-file-none",id:this.id+"_file_hidden_value_"+0}}))}this.pCont.appendChild(this.oNewFile.pFileCont);if(this.arConfig.viewMode||this.arConfig.fileExists&&!this.CheckNewFileState())this.HideNewFileState();if(!this.arConfig.fileExists)e.addClass(this.pCont,"adm-input-file-top-shift");var t=this;if(this.arConfig.useMedialib)window["SetValueFromMedialib"+this.id]=function(e){t.OnSelectFromMedialib(e)};if(this.arConfig.useFileDialog)window["SetValueFromFileDialog"+this.id]=function(e,i,s,n,l){t.OnSelectFromFileDialog(i+(i=="/"?"":"/")+e)};if(this.arConfig.useCloud)window["OpenCloudDialog"+this.id]=function(){t.oNewFile.pTextInput.onchange=e.proxy(t.OnCloudInputChange,t);e.util.popup(t.arConfig.cloudDialogPath+t.oNewFile.pTextInput.id,710,600)}};e.file_input.prototype.DisplayExistFile=function(i){var t=this.arConfig.files[i];if(t.FILE_NOT_FOUND){var s=e(this.id+"_menu_"+i);if(s&&this.arConfig.showDel){this.SetOpenerMenu(s,[{TEXT:e.message("ADM_FILE_DELETE"),ONCLICK:e.proxy(this.DeleteFile,this),GLOBAL_ICON:"adm-menu-delete"}])}}else{if(!this.arConfig.viewMode){var s=e(this.id+"_menu_"+i);if(s){var n=e.clone(this.arConfig.menuExist);if(this.arConfig.showDel||this.arConfig.showDesc)n.push({SEPARATOR:true});if(this.arConfig.showDel)n.push({TEXT:e.message("ADM_FILE_DELETE"),ONCLICK:e.proxy(this.DeleteFile,this),GLOBAL_ICON:"adm-menu-delete"});if(this.arConfig.showDesc&&t.DESCRIPTION=="")n.push({TEXT:e.message("ADM_FILE_ADD_DESC"),ONCLICK:e.proxy(this.AddDescription,this),GLOBAL_ICON:"adm-menu-add-desc"});this.SetOpenerMenu(s,n);if(!t.IS_IMAGE)s.style.top="-6px"}var l=e(this.id+"_file_cont_"+i);if(l){var a=t.INPUT_NAME||this.GetInputName("first_input"),p;if(this.arConfig.useUpload)p=e.create("INPUT",{props:{type:"file",name:a,className:"adm-designed-file adm-input-file-none"}});else p=e.create("INPUT",{props:{type:"hidden",value:t.PATH||t.SRC,name:a}});p.id=this.id+"_file_hidden_value_"+i;l.appendChild(p)}}if(t.IS_IMAGE){var o=e(this.id+"_file_disp_"+i),h=e.findChild(o,{tag:"IMG"},true);if(h){var u=h,f=parseInt(h.getAttribute("height")||h.offsetHeight),r=parseInt(h.getAttribute("width")||h.offsetWidth);if(this.arConfig.minPreviewHeight>f||this.arConfig.minPreviewWidth>r){if(this.arConfig.minPreviewHeight<f)o.style.height=f+4+"px";if(this.arConfig.minPreviewWidth<r)o.style.width=r+4+"px";if(u.parentNode.tagName.toLowerCase()=="a")u=u.parentNode;e.addClass(o,"adm-input-file-bordered");u.style.position="absolute";u.style.top="50%";u.style.left="50%";u.style.marginTop=Math.round(-f/2)+"px";u.style.marginLeft=Math.round(-r/2)+"px"}}}}};e.file_input.prototype.SetOpenerMenu=function(i,t){var s=this;if(!!i.OPENER)return true;i.OPENER=new e.COpener({DIV:i,TYPE:"click",MENU:t,ACTIVE_CLASS:"adm-btn-active"});e.addCustomEvent(i.OPENER,"onOpenerMenuOpen",function(){s.SetCurrentFile(i.getAttribute("data-bx-meta"));var t,n=i.OPENER.GetMenu().ITEMS;for(t in n){if(n[t]&&n[t].ID=="upload"&&e.isNodeInDom(n[t].NODE)){s.oNewFile.pUploadInput.setAttribute("data-bx-moved",true);n[t].NODE.appendChild(s.oNewFile.pUploadInput);e.addClass(n[t].NODE,"adm-input-file-ext-class");break}}});e.addCustomEvent(i.OPENER,"onOpenerMenuClose",function(){var t,n=i.OPENER.GetMenu().ITEMS;for(t in n){if(n[t].ID=="upload"&&e.isNodeInDom(n[t].NODE)){e.removeClass(n[t].NODE,"adm-input-file-ext-class");e.defer(function(){if(s.oNewFile.pUploadInput.getAttribute("data-bx-moved")){s.oNewFile.pUploadInput.removeAttribute("data-bx-moved");s.oNewFile.pUploadCont.appendChild(s.oNewFile.pUploadInput)}})();break}}})};e.file_input.prototype.AddNewFileBlock=function(){var i=[];if(!this.multiple){i=e.clone(this.arConfig.menuNew);i.push({SEPARATOR:true})}i.push({TEXT:e.message("ADM_FILE_CLEAR"),ONCLICK:e.proxy(this.ClearNewFile,this),GLOBAL_ICON:"adm-menu-delete"});var t=this.DisplayFileBlock(i);this.pCont.appendChild(t.pFileCont);if(this.multiple)e.addClass(t.pFileCont,"adm-input-cont-bordered");return t};e.file_input.prototype.OnUploadInputChange=function(i){var t,s,n,l=i.target||i.srcElement,a="",p=l.files||[l.value];p=p[0];s=p.name||p;t=Math.max(s.lastIndexOf("/"),s.lastIndexOf("\\"));if(t>0)s=s.substring(t+1,s.length);this.curFileIndex=false;if(this.arConfig.fileExists&&this.arConfig.files&&!this.multiple){this.DeleteFile(false);this.oNewFile.pTextInput.style.display="none";this.oNewFile.pUploadLabel.innerHTML=e.util.htmlspecialchars(s);this.oNewFile.pUploadCont.style.display="";this.SetInputName(this.oNewFile.pUploadInput,this.GetInputName("upload"));this.SetHiddenInputName(0,"");var o=e.findChild(e(this.id+"_file_cont_0"),{tagName:"input",attr:{name:this.GetInputName("del")}});if(o)e.cleanNode(o,true);n=this.arConfig.files&&this.arConfig.files[0]?this.arConfig.files[0]:false;if(n&&n.DESCRIPTION!=="")a=n.DESCRIPTION;this.ShowFileDescription(this.oNewFile,a)}else{var h;if(!this.multiple&&this.newFileCount>0){h=this.ClearNames(this.oFiles[0])}else{if(this.multiple)this.ClearNewFile();h=this.AddNewFileBlock();var u=h.pUploadInput;h.pUploadInput=this.oNewFile.pUploadInput;this.oNewFile.pUploadInput=u;this.oNewFile.pUploadCont.appendChild(this.oNewFile.pUploadInput);h.pUploadCont.appendChild(h.pUploadInput)}h.pTextInput.style.display="none";h.pUploadLabel.innerHTML=e.util.htmlspecialchars(s);h.pUploadCont.style.display="";this.SetInputName(h.pUploadInput,this.GetInputName("upload"));if(this.multiple)this.curFileIndex=this.newFileCount;if(this.multiple||!this.newFileCount)this.PushToFiles(h);var f=parseInt(this.GetCurrentFile(),10);this.SetHiddenInputName(f,"");if(!isNaN(f)&&this.multiple){this.DeleteFile(false);var r=e(this.id+"_menu_"+f);r.style.display="none";h.pMenu.style.display="inline-block";h.pMenu.setAttribute("data-bx-meta",f);n=this.arConfig.files&&this.arConfig.files[f]?this.arConfig.files[f]:false;var d=e(this.id+"_file_cont_"+f);if(n){if(n.DESCRIPTION!=="")a=n.DESCRIPTION;this.SetInputName(h.pUploadInput,n.INPUT_NAME);this.SetInputName(h.pTextInput,"");this.SetInputName(h.pDescInput,n.DESC_NAME)}d.appendChild(h.pFileCont)}this.ShowFileDescription(h,a);if(this.multiple)this.pCont.appendChild(this.oNewFile.pFileCont);if(!this.CheckNewFileState())this.HideNewFileState()}e.onCustomEvent("onMenuItemSelected");if(e.browser.IsIE())e(this.id+"_ie_bogus_container").innerHTML=e(this.id+"_ie_bogus_container").innerHTML;if(e.browser.IsIE()||e.browser.IsIE11()){var C=this.oNewFile.pFileCont.parentNode.appendChild(e.create("INPUT",{props:{type:"text",className:"adm-input-fake-inp"}}));C.focus();C.select()}};e.file_input.prototype.OnSelectFromMedialib=function(i){var t="";this.curFileIndex=false;if(this.arConfig.fileExists&&this.arConfig.files&&!this.multiple){this.DeleteFile(false);this.oNewFile.pTextInput.value=i.src||"";this.oNewFile.pTextInput.style.display="";this.oNewFile.pUploadCont.style.display="none";this.SetInputName(this.oNewFile.pTextInput,this.GetInputName("medialib"));this.FocusInput(this.oNewFile.pTextInput);this.oNewFile.pDescInput.value=i.description||"";this.SetHiddenInputName(0,"");var s=e.findChild(e(this.id+"_file_cont_0"),{tagName:"input",attr:{name:this.GetInputName("del")}});if(s)e.cleanNode(s,true);t=i.description||"";var n=this.arConfig.files&&this.arConfig.files[0]?this.arConfig.files[0]:false;if(n&&n.DESCRIPTION!=="")t=n.DESCRIPTION;this.ShowFileDescription(this.oNewFile,t)}else{var l;if(!this.multiple&&this.newFileCount>0)l=this.ClearNames(this.oFiles[0]);else l=this.AddNewFileBlock();l.pTextInput.value=i.src||"";l.pTextInput.style.display="";l.pUploadCont.style.display="none";this.SetInputName(l.pTextInput,this.GetInputName("medialib"));this.FocusInput(l.pTextInput);t=i.description||"";if(this.multiple)this.curFileIndex=this.newFileCount;if(this.multiple||!this.newFileCount)this.PushToFiles(l);var a=parseInt(this.GetCurrentFile(),10);if(isNaN(a)&&!this.multiple)this.SetHiddenInputName(0,"");else this.SetHiddenInputName(a,"");if(!isNaN(a)&&this.multiple){this.DeleteFile(false);var p=e(this.id+"_menu_"+a);p.style.display="none";l.pMenu.style.display="inline-block";l.pMenu.setAttribute("data-bx-meta",a);var n=this.arConfig.files&&this.arConfig.files[a]?this.arConfig.files[a]:false,o=e(this.id+"_file_cont_"+a);if(n){if(n.DESCRIPTION!=="")t=n.DESCRIPTION;this.SetInputName(l.pTextInput,n.INPUT_NAME);this.SetInputName(l.pDescInput,n.DESC_NAME)}o.appendChild(l.pFileCont)}this.ShowFileDescription(l,t);if(this.multiple)this.pCont.appendChild(this.oNewFile.pFileCont);if(!this.CheckNewFileState())this.HideNewFileState()}};e.file_input.prototype.OnSelectFromFileDialog=function(i){var t="",s;this.curFileIndex=false;if(this.arConfig.fileExists&&this.arConfig.files&&!this.multiple){this.DeleteFile(false);this.oNewFile.pTextInput.value=i||"";this.oNewFile.pTextInput.style.display="";this.oNewFile.pUploadCont.style.display="none";this.SetInputName(this.oNewFile.pTextInput,this.GetInputName("file_dialog"));this.FocusInput(this.oNewFile.pTextInput);this.SetHiddenInputName(0,"");var n=e.findChild(e(this.id+"_file_cont_0"),{tagName:"input",attr:{name:this.GetInputName("del")}});if(n)e.cleanNode(n,true);s=this.arConfig.files&&this.arConfig.files[0]?this.arConfig.files[0]:false;if(s&&s.DESCRIPTION!=="")t=s.DESCRIPTION;this.ShowFileDescription(this.oNewFile,t)}else{var l;if(!this.multiple&&this.newFileCount>0)l=this.ClearNames(this.oFiles[0]);else l=this.AddNewFileBlock();l.pTextInput.value=i||"";l.pTextInput.style.display="";l.pUploadCont.style.display="none";this.SetInputName(l.pTextInput,this.GetInputName("file_dialog"));this.FocusInput(l.pTextInput);if(this.multiple)this.curFileIndex=this.newFileCount;if(this.multiple||!this.newFileCount)this.PushToFiles(l);var a=parseInt(this.GetCurrentFile(),10);if(isNaN(a)&&!this.multiple)this.SetHiddenInputName(0,"");else this.SetHiddenInputName(a,"");s=false;if(!isNaN(a)&&this.multiple){this.DeleteFile(false);var p=e(this.id+"_menu_"+a);p.style.display="none";l.pMenu.style.display="inline-block";l.pMenu.setAttribute("data-bx-meta",a);s=this.arConfig.files&&this.arConfig.files[a]?this.arConfig.files[a]:false;var o=e(this.id+"_file_cont_"+a);if(s){this.ShowFileDescription(l,s.DESCRIPTION||"");this.SetInputName(l.pTextInput,s.INPUT_NAME);this.SetInputName(l.pDescInput,s.DESC_NAME);l.pDescInput.value=s.DESCRIPTION||""}o.appendChild(l.pFileCont)}if(!s){this.ShowFileDescription(l,"")}if(this.multiple)this.pCont.appendChild(this.oNewFile.pFileCont);if(!this.CheckNewFileState())this.HideNewFileState()}};e.file_input.prototype.OnCloudInputChange=function(){var i=this.oNewFile.pTextInput.value;var t="";this.curFileIndex=false;if(this.arConfig.fileExists&&this.arConfig.files&&!this.multiple){this.DeleteFile(false);this.oNewFile.pTextInput.value=i||"";this.oNewFile.pTextInput.style.display="";this.oNewFile.pUploadCont.style.display="none";this.SetInputName(this.oNewFile.pTextInput,this.GetInputName("cloud"));this.SetHiddenInputName(0,"");var s=e.findChild(e(this.id+"_file_cont_0"),{tagName:"input",attr:{name:this.GetInputName("del")}});if(s)e.cleanNode(s,true);var n=this.arConfig.files&&this.arConfig.files[0]?this.arConfig.files[0]:false;if(n&&n.DESCRIPTION!=="")t=n.DESCRIPTION;this.ShowFileDescription(this.oNewFile,t)}else{this.oNewFile.pTextInput.value="";var l;if(!this.multiple&&this.newFileCount>0)l=this.ClearNames(this.oFiles[0]);else l=this.AddNewFileBlock();l.pTextInput.value=i||"";l.pTextInput.style.display="";l.pUploadCont.style.display="none";this.SetInputName(l.pTextInput,this.GetInputName("cloud"));if(this.multiple)this.curFileIndex=this.newFileCount;if(this.multiple||!this.newFileCount)this.PushToFiles(l);var a=parseInt(this.GetCurrentFile(),10);if(isNaN(a)&&!this.multiple)this.SetHiddenInputName(0,"");else this.SetHiddenInputName(a,"");if(!isNaN(a)&&this.multiple){this.DeleteFile(false);var p=e(this.id+"_menu_"+a);p.style.display="none";l.pMenu.style.display="inline-block";l.pMenu.setAttribute("data-bx-meta",a);var n=this.arConfig.files&&this.arConfig.files[a]?this.arConfig.files[a]:false,o=e(this.id+"_file_cont_"+a);if(n){if(n.DESCRIPTION!=="")t=n.DESCRIPTION;this.SetInputName(l.pTextInput,n.INPUT_NAME);this.SetInputName(l.pDescInput,n.DESC_NAME)}o.appendChild(l.pFileCont)}this.ShowFileDescription(l,t);if(this.multiple)this.pCont.appendChild(this.oNewFile.pFileCont);if(!this.CheckNewFileState())this.HideNewFileState()}this.oNewFile.pTextInput.onchange=null};e.file_input.prototype.ShowFileDescription=function(i,t){if(this.arConfig.showDesc){i.pDesc.style.display="";this.SetInputName(i.pDescInput,this.GetInputName("desc"));e.removeClass(i.pDesc,"adm-input-file-show-desc");i.pDescInput.value=t||"";if(t)e.addClass(i.pDesc,"adm-input-file-show-desc");else e.removeClass(i.pDesc,"adm-input-file-show-desc")}};e.file_input.prototype.DisplayFileBlock=function(i){var t=e.create("DIV",{props:{className:"adm-input-file-new"}}),s=t.appendChild(e.create("SPAN",{props:{className:"adm-input-file"}})),n=s.appendChild(e.create("SPAN",{text:e.message("ADM_FILE_ADD")})),l=s.appendChild(e.create("INPUT",{props:{type:"file",className:"adm-designed-file"}}));t.appendChild(document.createTextNode(" "));e.bind(l,"change",e.proxy(this.OnUploadInputChange,this));var a=this;e.bind(l,"mousedown",function(){var i=e.findParent(this,{className:"adm-input-file-new"},function(i){return e.hasClass(i,"adm-input-file-ext-class")||e.hasClass(i,"adm-input-file-control")});if(i){var t=e.findChild(i,{className:"add-file-popup-btn"});if(t&&t.getAttribute("data-bx-meta")!==null)a.SetCurrentFile(t.getAttribute("data-bx-meta"))}});var p=t.appendChild(e.create("INPUT",{props:{type:"text",className:"adm-input",size:this.inputSize},style:{display:"none"}}));var o=t.appendChild(e.create("SPAN",{props:{className:"adm-btn add-file-popup-btn"}}));o.setAttribute("data-bx-meta","new");this.SetOpenerMenu(o,i||this.arConfig.menuNew);var h=t.appendChild(e.create("SPAN",{props:{className:"adm-input-file-desc"},style:{display:"none"}})),u=h.appendChild(e.create("SPAN",{props:{className:"adm-input-file-desc-link"},text:e.message("ADM_FILE_ADD_DESC")})),f=h.appendChild(e.create("INPUT",{props:{type:"text",className:"adm-input",size:this.inputSize,placeholder:e.message("ADM_FILE_DESC")}}));u.onclick=function(){e.addClass(h,"adm-input-file-show-desc");e.defer(function(){e.focus(f)})()};if(!this.arConfig.useUpload){s.style.display="none";p.style.display=""}return{pFileCont:t,pUploadCont:s,pUploadLabel:n,pUploadInput:l,pTextInput:p,pDesc:h,pDescInput:f,pMenu:o}};e.file_input.prototype.DeleteFile=function(i){var t=parseInt(this.GetCurrentFile(),10),s=this.arConfig.files&&this.arConfig.files[t]?this.arConfig.files[t]:false,n=e(this.id+"_file_cont_"+t);if(!this.arConfig.useUpload)this.SetHiddenInputName(t,"");if(n){if(i)n.appendChild(e.create("INPUT",{props:{id:this.id+"_file_del_"+t,type:"hidden",value:"Y",name:this.GetInputName("del",s)}}));e.addClass(n,"adm-input-file-deleted")}if(this.multiple){var l=e(this.id+"_menu_"+t);l.style.display="inline-block";l.OPENER.SetMenu([{TEXT:e.message("ADM_FILE_CANCEL_DEL"),ONCLICK:e.proxy(this.CancelDelete,this)}])}var a=e(this.id+"_file_del_lbl_"+t);if(a){a.style.marginLeft=-parseInt(a.offsetWidth/2)+"px";a.style.marginTop=-parseInt(a.offsetHeight/2)+"px"}if(this.oNewFile){this.oNewFile.pFileCont.style.display="";if(!this.arConfig.useUpload)this.SetInputName(this.oNewFile.pTextInput,this.GetInputName("first_input"));if(i!==false&&!this.multiple){var p=e.clone(this.arConfig.menuNew);p.push({SEPARATOR:true});p.push({TEXT:e.message("ADM_FILE_CANCEL_DEL"),ONCLICK:e.proxy(this.CancelDelete,this)});this.oNewFile.pMenu.OPENER.SetMenu(p)}}};e.file_input.prototype.CancelDelete=function(){var i=parseInt(this.GetCurrentFile(),10);if(isNaN(i)&&!this.multiple)i=0;var t=this.arConfig.files&&this.arConfig.files[i]?this.arConfig.files[i]:false,s=e(this.id+"_file_cont_"+i),n=e(this.id+"_file_hidden_value_"+i);if(n)this.SetInputName(n,t.INPUT_NAME||this.GetInputName("first_input"));if(s){e.removeClass(s,"adm-input-file-deleted");var l=e.findChild(s,{tagName:"input",attr:{name:this.GetInputName("del",t)}});if(l)e.cleanNode(l,true);if(t.FILE_NOT_FOUND){var a=e(this.id+"_menu_"+i);if(a&&this.arConfig.showDel){a.OPENER.SetMenu([{TEXT:e.message("ADM_FILE_DELETE"),ONCLICK:e.proxy(this.DeleteFile,this),GLOBAL_ICON:"adm-menu-delete"}])}}else if(this.multiple){var a=e(this.id+"_menu_"+i);var p=e.clone(this.arConfig.menuExist);if(this.arConfig.showDel||this.arConfig.showDesc)p.push({SEPARATOR:true});if(this.arConfig.showDel)p.push({TEXT:e.message("ADM_FILE_DELETE"),ONCLICK:e.proxy(this.DeleteFile,this),GLOBAL_ICON:"adm-menu-delete"});if(this.arConfig.showDesc&&t.DESCRIPTION=="")p.push({TEXT:e.message("ADM_FILE_ADD_DESC"),ONCLICK:e.proxy(this.AddDescription,this),GLOBAL_ICON:"adm-menu-add-desc"});a.OPENER.SetMenu(p)}if(this.oNewFile&&!this.multiple){this.oNewFile.pFileCont.style.display="none";this.SetInputName(this.oNewFile.pUploadInput,"");this.SetInputName(this.oNewFile.pTextInput,"")}}};e.file_input.prototype.AddDescription=function(){var i=parseInt(this.GetCurrentFile(),10),t=e(this.id+"_file_desc_"+i);if(t){t.style.display="";var s=e.findChild(t,{tag:"input"});if(s)e.focus(s)}};e.file_input.prototype.GetCurrentFile=function(){return this.currentFileId};e.file_input.prototype.SetCurrentFile=function(e){this.currentFileId=e};e.file_input.prototype.CheckNewFileState=function(){if(!this.multiple||this.maxCount>0&&this.fileCount>=this.maxCount)return false;return true};e.file_input.prototype.HideNewFileState=function(){this.oNewFile.pFileCont.style.display="none";this.ClearNames(this.oNewFile)};e.file_input.prototype.ClearNames=function(e){e.pUploadInput.name="";e.pTextInput.name="";e.pDescInput.name="";e.pUploadInput.removeAttribute("name");e.pTextInput.removeAttribute("name");e.pDescInput.removeAttribute("name");return e};e.file_input.prototype.GetInputName=function(e,i){var t="";if(this.multiple){if(e=="del"||e=="desc"){if(e=="del")t=i&&i.DEL_NAME?i.DEL_NAME:this.arConfig.delName;else if(e=="desc")t=i&&i.DESC_NAME?i.DESC_NAME:this.arConfig.descName}else{t=this.arConfig.inputNameTemplate}if(this.curFileIndex===false)t=t.replace("#IND#",this.newFileCount);else if(this.curFileIndex===undefined)t=t.replace("#IND#","new");else t=t.replace("#IND#",this.curFileIndex)}else{if(e=="first_input"){if(this.arConfig.useUpload)e="upload";if(this.arConfig.useMedialib)e="medialib";else if(this.arConfig.useFileDialog)e="file_dialog";else if(this.arConfig.useCloud)e="cloud"}if(this.arConfig.inputs&&this.arConfig.inputs[e])t=this.arConfig.inputs[e].NAME}if(e=="del"&&!t)t=this.arConfig.delName;if(e=="desc"&&!t)t=this.arConfig.descName;return t};e.file_input.prototype.ClearNewFile=function(){var i=this.GetCurrentFile();if(this.multiple){this.CancelDelete();var t=parseInt(this.GetCurrentFile(),10),s=e(this.id+"_file_cont_"+t);if(s){var n=e.findChild(s,{className:"adm-input-file-new"});if(n)e.cleanNode(n,true);var l=e(this.id+"_menu_"+t);l.style.display="inline-block"}}if(!i||i.substr(0,4)!="new_")return;var a=parseInt(i.substr(4),10);if(isNaN(a)||!this.oFiles[a])return;this.newFileCount--;this.fileCount=this.arConfig.files.length+this.newFileCount-1;this.oNewFile.pFileCont.style.display="";this.oFiles[a].pFileCont.parentNode.removeChild(this.oFiles[a].pFileCont)};e.file_input.prototype.PushToFiles=function(e){this.oFiles.push(e);this.newFileCount++;this.fileCount=this.arConfig.files.length+this.newFileCount-1;e.pMenu.setAttribute("data-bx-meta","new_"+(this.oFiles.length-1))};e.file_input.prototype.SetInputName=function(e,i){e.name=i;e.setAttribute("name",i)};e.file_input.prototype.ShowPath=function(){this.OnSelectFromFileDialog("")};e.file_input.prototype.FocusInput=function(i){if(i)e.defer(function(){if(i){e.focus(i)}})()};e.file_input.prototype.SetHiddenInputName=function(i,t){if(!isNaN(i)){var s=e(this.id+"_file_hidden_value_"+(i||0));if(s)this.SetInputName(s,t||"")}}})();
//# sourceMappingURL=core_file_input.map.js